import Mock from 'mockjs'
import loginAPI from './login'
import taskAPI from './task'
import articleAPI from './article'
import remoteSearchAPI from './remoteSearch'
import transactionAPI from './transaction'

Mock.setup({
  timeout: '350-600'
})

// 登录相关
// Mock.mock(/\/api\/v1\/auth\/getToken/, 'post', loginAPI.getLoginToken())
Mock.mock(/\/api\/v1\/auth\/getUserInfoById/, 'get', loginAPI.getUserInfo())
Mock.mock(/\/api\/v1\/auth\/logout/, 'get', loginAPI.logout)
Mock.mock(/\/user\/info\.*/, 'get', loginAPI.getUserInfo)

// 文章相关
Mock.mock(/\/article\/list/, 'get', articleAPI.getList)
Mock.mock(/\/article\/detail/, 'get', articleAPI.getArticle)
Mock.mock(/\/article\/pv/, 'get', articleAPI.getPv)
Mock.mock(/\/article\/create/, 'post', articleAPI.createArticle)
Mock.mock(/\/article\/update/, 'post', articleAPI.updateArticle)

// 搜索相关
Mock.mock(/\/search\/user/, 'get', remoteSearchAPI.searchUser)

// 账单相关
Mock.mock(/\/transaction\/list/, 'get', transactionAPI.getList)

// 任务相关
Mock.mock(/\/api\/v1\/task\/getListByPublicerDDId/, 'get', taskAPI.getListByPublicerDDId)
Mock.mock(/\/api\/v1\/task\/getAcceptedListForReceivers/, 'get', taskAPI.getAcceptedListForReceivers)
Mock.mock(/\/api\/v1\/task\/getUnacceptedListForReceivers/, 'get', taskAPI.getUnacceptedListForReceivers)
Mock.mock(/\/api\/v1\/task\/getDetailById/, 'get', taskAPI.getDetailById)
Mock.mock(/\/api\/v1\/task\/saveByPublicer/, 'post', taskAPI.saveByPublicer)
Mock.mock(/\/api\/v1\/task\/saveByReceiver/, 'post', taskAPI.saveByReceiver)
Mock.mock(/\/api\/v1\/task\/saveByReceiver/, 'post', taskAPI.saveByReceiver)
Mock.mock(/\/api\/v1\/task\/receiveTaskById/, 'post', taskAPI.receiveTaskById)
export default Mock
